/**    
 * @{#} RegisterActivity.java Create on 2014-5-26 下午9:51:05    
 *          
 * @author <a href="mailto:evan0502@qq.com">Evan</a>   
 * @version 1.0    
 */
package com.smiier.skin;

import org.json.JSONObject;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import cn.o.app.ui.OImageView;
import cn.skinapp.R;

import com.smiier.skin.constant.Constant;
import com.smiier.skin.ui.BasicActivity;
import com.smiier.skin.util.GlobalSettings;
import com.smiier.skin.utils.CommonUtility;
import com.umeng.analytics.MobclickAgent;

public class Cost2DoctorSuccessActivity extends BasicActivity {

	JSONObject mDoctorInfo;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_cost_2_doctor_successfully);

		init();
		back.setVisibility(View.GONE);
		setNavTitle("付费咨询");
		TextView text_doctor_profile = (TextView) findViewById(R.id.text_doctor_profile);
		OImageView img_doctor_icon = (OImageView) findViewById(R.id.img_doctor_icon);
		try {
			mDoctorInfo = new JSONObject(getIntent().getStringExtra(
					Constant.IDENTITY_KEY_1));
			StringBuilder sb = new StringBuilder();
			sb.append(mDoctorInfo.getString("Name"))
					.append(" | ")
					.append(mDoctorInfo.getString("Hospital"))
					.append(CommonUtility.convertJSONArray2String(
							mDoctorInfo.getJSONArray("Professional"), ","));
			text_doctor_profile.setText(sb);
			String iconPath = mDoctorInfo.getString("Pic");
			if (iconPath.indexOf(".") != -1) {
				iconPath = GlobalSettings.SERVER_IMG_URL + iconPath;
			} else {
				iconPath = GlobalSettings.SERVER_IMG_URL + iconPath
						+ Constant.IMG_TH;
			}
			// mBitmapUtils.display(img_doctor_icon, iconPath,
			// new OBitmapLoadCallBack<View>());
			CommonUtility.displayHeadImage(img_doctor_icon, mBitmapUtils,
					iconPath, getResources(), GlobalSettings.sUser.Sex);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Override
	public void onClick(View view) {
		Intent intent = getIntent().setClass(activity,
				CreateQuestionActivity.class);
		intent.putExtra(Constant.IDENTITY_KEY_CREATE_COST_2_DOCTOR, true);
		intent.putExtra(Constant.IDENTITY_KEY_QUESTION_EDIT, true);
		intent.putExtra(Constant.IDENTITY_KEY_DOCTOR_INFO,
				mDoctorInfo.toString());
		startActivity(intent);
	}

	@Override
	public void onBackPressed() {
	}
	
	
	
/*	@Override
	public void onResume() {
		super.onResume();
		MobclickAgent.onResume(getContext());
	}

	@Override
	public void onPause() {
		super.onPause();
		MobclickAgent.onPause(getContext());
	}*/
	
}
